/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateRestaurantData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = com.luisgutierrez.pds.prueba2.RestaurantPersistentManager.instance().getSession().beginTransaction();
		try {
			com.luisgutierrez.pds.prueba2.DAOFactory lDAOFactory = com.luisgutierrez.pds.prueba2.DAOFactory.getDAOFactory();
			com.luisgutierrez.pds.prueba2.dao.PedidoDAO lcomluisgutierrezpdsprueba2PedidoDAO = lDAOFactory.getPedidoDAO();
			com.luisgutierrez.pds.prueba2.Pedido lcomluisgutierrezpdsprueba2Pedido = lcomluisgutierrezpdsprueba2PedidoDAO.createPedido();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : estado, detalle, mesa
			lcomluisgutierrezpdsprueba2PedidoDAO.save(lcomluisgutierrezpdsprueba2Pedido);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateRestaurantData createRestaurantData = new CreateRestaurantData();
			try {
				createRestaurantData.createTestData();
			}
			finally {
				com.luisgutierrez.pds.prueba2.RestaurantPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
